import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        userPhoto: 'https://img1.baidu.com/it/u=1738531146,3909274171&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500', //头像地址（默认）
        // userName: 'giaoben'
    },
    mutations: {
        // 编码风格，mutations最好大写（作区分）
        SET_USERPGOTO(state, value) {
            // 将userPhoto的值赋给value
            state.userPhoto = value
        },
        // SET_USERNAME(state, value) {
        //     state.userName = value
        // }
    },
    actions: {},
    modules: {}
})